package com.guigu.tms.manager.controller.wj;

import com.github.pagehelper.PageInfo;
import com.guigu.tms.commons.entity.base.PdTruckDriver;
import com.guigu.tms.manager.feign.wj.TruckDriverFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/pdTruckDriver")
public class TruckDriverController {

    @Autowired
    TruckDriverFeignClient truckDriverFeignClient;

    @PostMapping("/findTruckDriverList")
    public PageInfo<PdTruckDriver> findTruckDriverList(@RequestBody Map<String, String> map){
        PageInfo<PdTruckDriver> driverList = truckDriverFeignClient.findTruckDriverList(map);
        System.out.println(driverList);
        return driverList;
    }

    @PutMapping("/UpdateFleetByDriver")
    public int UpdateFleetByDriver(@RequestBody PdTruckDriver pdTruckDriver){
        return truckDriverFeignClient.UpdateFleetByDriver(pdTruckDriver);
    }
}
